|
|
@@ -11,30 +11,54 @@ module Agents
|
11
|
11
|
description <<-MD
|
12
|
12
|
This agent periodically triggers a run of each target Agent according to a user-defined schedule.
|
13
|
13
|
|
14
|
|
- Select target Agents and set a cron-style schedule to `schedule`.
|
15
|
|
- In the traditional cron format, a schedule part consists of these five columns: `minute hour day-of-month month day-of-week`.
|
|
14
|
+ # Targets
|
|
15
|
+
|
|
16
|
+ Select Agents that you want to run periodically by this SchedulerAgent.
|
|
17
|
+
|
|
18
|
+ # Schedule
|
|
19
|
+
|
|
20
|
+ Set `schedule` to a schedule specification in the [cron](http://en.wikipedia.org/wiki/Cron) format.
|
|
21
|
+ For example:
|
16
|
22
|
|
17
|
23
|
* `0 22 * * 1-5`: every day of the week at 22:00 (10pm)
|
18
|
24
|
|
19
|
|
- In this variant, you can also specify seconds:
|
|
25
|
+ * `*/10 8-11 * * *`: every 10 minutes from 8:00 to and not including 12:00
|
20
|
26
|
|
21
|
|
- * `30 0 22 * * 1-5`: every day of the week at 22:00:30
|
|
27
|
+ This variant has several extensions as explained below.
|
22
|
28
|
|
23
|
|
- And timezones:
|
|
29
|
+ ## Timezones
|
|
30
|
+
|
|
31
|
+ You can optionally specify a timezone (default: `#{Time.zone.name}`) after the day-of-week field.
|
24
|
32
|
|
25
|
33
|
* `0 22 * * 1-5 Europe/Paris`: every day of the week when it's 22:00 in Paris
|
26
|
34
|
|
27
|
35
|
* `0 22 * * 1-5 Etc/GMT+2`: every day of the week when it's 22:00 in GMT+2
|
28
|
36
|
|
29
|
|
- There's also a way to specify "last day of month":
|
|
37
|
+ ## Seconds
|
|
38
|
+
|
|
39
|
+ You can optionally specify seconds before the minute field.
|
|
40
|
+
|
|
41
|
+ * `*/30 * * * * *`: every 30 seconds
|
|
42
|
+
|
|
43
|
+ ## Last day of month
|
|
44
|
+
|
|
45
|
+ `L` signifies "last day of month" in `day-of-month`.
|
30
|
46
|
|
31
|
47
|
* `0 22 L * *`: every month on the last day at 22:00
|
32
|
48
|
|
33
|
|
- And "monthdays":
|
|
49
|
+ ## Weekday names
|
|
50
|
+
|
|
51
|
+ You can use three letter names instead of numbers in the `weekdays` field.
|
|
52
|
+
|
|
53
|
+ * `0 22 * * Sat,Sun`: every Saturday and Sunday, at 22:00
|
|
54
|
+
|
|
55
|
+ ## Nth weekday of the month
|
|
56
|
+
|
|
57
|
+ You can specify "nth weekday of the month" like this.
|
34
|
58
|
|
35
|
|
- * `0 22 * * sun#1,sun#2`: every first and second sunday of the month, at 22:00
|
|
59
|
+ * `0 22 * * Sun#1,Sun#2`: every first and second Sunday of the month, at 22:00
|
36
|
60
|
|
37
|
|
- * `0 22 * * sun#L1`: every last sunday of the month, at 22:00
|
|
61
|
+ * `0 22 * * Sun#L1`: every last Sunday of the month, at 22:00
|
38
|
62
|
MD
|
39
|
63
|
|
40
|
64
|
def default_options
|